<template>
  <div style="height:100%;display:flex;justify-content: space-between;padding:5px;">
    <div class="leftBox" ref="fatherDiv">
    <div class="proofNow"><i class="el-icon-mobile-phone"></i>{{$t('analyze.proofNum')}}：{{ proof_num }}</div>
        <a-tabs v-model="activeKey" type="card" size="small">
            <a-tab-pane key="1">
                <template #tab>
                    <span>
                        <i class="el-icon-user-solid"></i>
                    {{$t('analyze.renmaiquanzi')}}
                    </span>
                </template>
                <proof @changeContent="changeContent" />    
            </a-tab-pane>
            <a-tab-pane key="2">
                <template #tab>
                    <span>
                        <i class="el-icon-coin"></i>
                        {{$t('analyze.Capital_consumption')}}
                    </span>
                </template>
                <fund />    
            </a-tab-pane>
            <a-tab-pane key="3">
                <template #tab>
                    <span>
                        <i class="el-icon-bangzhu"></i>
                        {{$t('analyze.appquanzi')}}
                    </span>
                </template>
                <appCircle />    
            </a-tab-pane>
            <a-tab-pane key="4">
                <template #tab>
                    <span>
                        <i class="el-icon-map-location"></i>
                        {{$t('analyze.position')}}
                    </span>
                </template>
                <mapAnalyze />    
            </a-tab-pane>
        </a-tabs>
    </div>
    <div class="content">
        <proofAnalyze ref="proofAnalyze" />
    </div>
  </div>
</template>

<script>
import proof from '../proofOnly/proof/index.vue'
import fund from '../proofOnly/fund/index.vue'
import appCircle from '../appCircle/index.vue'
import mapAnalyze from '../mapAnalyze/index.vue'
import proofAnalyze from './proof.vue'
export default {
    name:'analyzeData',
    components:{
        proof,
        fund,
        appCircle,
        mapAnalyze,
        proofAnalyze
    },
    data(){
        return{
            activeKey:'1',
            proof_num:''
        }
    },
    created(){
        this.proof_num = sessionStorage.getItem('analyzeProof');
    },
    beforeRouteLeave(to, from, next) {
        // 判断是前进还是后退
        const isBackward = from.name && to.name && from.meta.index > to.meta.index;

        if (isBackward) {
        this.$router.push({ name: 'proofs'});
        }
        next();
    },
    methods:{
        scrollToBottom(){
            // 在DOM渲染后滚动到底部
            const container = this.$refs.fatherDiv;
            container.scrollTop = container.scrollHeight;
            },
        changeContent(){
                this.$refs.proofAnalyze.qiehuan()
        },
    }
}
</script>

<style>
.jietu{
  display: none;
}
</style>
<style scoped>
.proofNow{
    position: absolute;
    top: 5px;
    right: 15px;
    z-index: 1000;
    font-size: 18px;
    font-weight: bold;
    color: #7a7a7a;
}
.leftBox{
    width: 70%;
    height: 100%;
    border: 1px solid rgb(227, 227, 227);
    overflow-y: auto !important;
    position: relative;
}
.leftBox::-webkit-scrollbar {
width: 10px;
}
/* <!--修改 滚动条的 下面 的 样式--> */
.leftBox::-webkit-scrollbar-track {
background-color: rgb(252, 252, 252);
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius: 2em;
}
/* <!--修改 滑块 --> */
.leftBox::-webkit-scrollbar-thumb {
background-color: #e8e8e8;
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius: 2em;
}
.content{
    width: 500px;
    height: 100%;
    margin-right: 50px;
    /* border: 1px solid red; */
}

@media (min-width: 2360px) and (max-width: 2560px) {
    .content{
    width: 500px;
    height: 100%;
    margin-right: 50px;
    /* border: 1px solid red; */
}
}

/* 当屏幕宽度大于2560时 */
@media screen and (min-width: 2561px) {
    .content{
    width: 500px;
    height: 100%;
    margin-right: 50px;
    /* border: 1px solid red; */
}
}
</style>